package com.dubito.pattern.创建型模式.工厂模式.抽象工厂;

/**
 * @author liliang
 * @date 2020/8/26.
 */
public class ClientDemo {

    public static void main(String[] args) {

        AbstractFactory factory1 = new ConcreteFactory1();
        AbstractFactory factory2 = new ConcreteFactory2();

        // 生产等级为1的产品 A
        ProductA a1 = new ProductA1();

        // 生产等级为2的产品 A
        ProductA a2 = new ProductA2();

        // 生产等级为1的产品 B
        ProductB b1 = new ProductB1();

        // 生产等级为2的产品 B
        ProductB b2 = new ProductB2();

        a1.method1();
        a2.method1();

        b1.method1();
        b2.method1();
    }
}
